﻿using System.Threading.Tasks;
using MongoDB.Driver;
using Sustainalytics.Entities.RiskRatings;

namespace Sustainalytics.ClientDW.Synchronization.SyncRiskRatingsData
{
    public class CoreRiskRatingIndicatorIndexes
    {
        public static async Task RecreateIndexes(IMongoCollection<CoreRiskRatingIndicator> collection)
        {
            await collection.Indexes.CreateOneAsync(Builders<CoreRiskRatingIndicator>.IndexKeys.Ascending(x => x.Id)).ConfigureAwait(false);
            await collection.Indexes.CreateOneAsync(Builders<CoreRiskRatingIndicator>.IndexKeys.Ascending(x => x.CompanyId)).ConfigureAwait(false);
            await collection.Indexes.CreateOneAsync(Builders<CoreRiskRatingIndicator>.IndexKeys.Ascending(x => x.ExternalId)).ConfigureAwait(false);
        }
    }
}
